/*
 * RoleMapper.java
 *
 * Copyright 2012 the original author or authors(ninglong).
 *
 * Licensed under the web-geek, Version 1.0 (the "License");
 *
 */
package org.geek.core.mybatis.mapper;

import java.util.List;

import org.geek.core.annotation.MyBatisUtil;
import org.geek.core.mybatis.domain.Criteria;
import org.geek.core.mybatis.domain.Role;

/**
 * <p></p>
 * @author ninglong bhd2973@qq.com
 * @version V1.0
 */
@MyBatisUtil
public interface RoleMapper {
	
	int countRoleByCriteria(Criteria criteria);
	
	List<Role> getRoleByCriteria(Criteria criteria);
	
	int addRole(Role role);
	
	int modRole(Role role);
	
	int delRoleByRoleId(int roleId);
	
	int delRoleAndUserByRoleId(int roleId);
	
	int delAuthByRoleIdAndResouceId(Criteria criteria);
	
	int saveAuth(Criteria criteria);
	
	List<Role> getRoles2User(int userId);
}
